from PIL import Image, ImageDraw, ImageFont

# 创建画布
img = Image.new('RGB', (800, 400), color='white')
draw = ImageDraw.Draw(img)

# 绘制标题
draw.text((10, 10), "Guess the Secret Number", fill="black", align="left")

# 绘制模拟的猜测结果
draw.text((10, 50), "Attempt 1: Guess 50 - Too Low", fill="blue")
draw.text((10, 90), "Attempt 2: Guess 75 - Too High", fill="blue")
draw.text((10, 130), "Attempt 3: Guess 63 - Correct!", fill="green")

# 绘制装饰性的数字和提示框
draw.rectangle([10, 170, 790, 300], outline="black", width=2)
draw.text((20, 180), "Tips: Keep narrowing down your guesses!", fill="black")

# 保存图片
img_path = "guess_game_simulation.png"
img.save(img_path)
print(f"图形已保存到 {img_path}")